MCI Functions, Macros, and Messages

Most MCI applications use the mciSendString1PGC_K2 and mciSendCommand_H60X4 functions dozens of times. MCI provides some other useful functions that your application will use less frequently.

The device identifier required by most MCI commands is typically retrieved in a call to the open1GMTS1P (MCI_OPEN12F69Z1) command. If you need a device identifier but do not want to open the device   for example, if you want to query the capabilities of the device before taking any other action   you can call the mciGetDeviceID1WDYSYP function.

The mciGetCreatorTaskD1GZHW function allows your application to use a device identifier to retrieve a handle to the task that created that identifier.

You can use the mciGetYieldProc1L5VFRI and mciSetYieldProc1MP7Z6T functions to assign and retrieve the address of the callback function associated with the  wait  (MCI_WAIT) flag.

The mciGetErrorStringY6KOFT function retrieves a string that describes an MCI error value. Each string that MCI returns, whether data or an error description, is a maximum of 128 characters. Dialog box fields that are smaller than 128 characters will truncate the longer strings returned by MCI. For more information about these strings, see Constants: MCIERR Return ValuesK4YZ76.

The MCI macros are tools you can use to create and disassemble values that specify time formats. These time formats are used in many MCI commands. The formats acted on by the macros are hours/minutes/seconds (HMS), minutes/seconds/frames (MSF), and tracks/minutes/seconds/frames (TMSF). The following table lists the macros and their descriptions.

Macro

Description

MCI_HMS_HOURIFSXX6

Retrieves the hours component from an HMS value.

MCI_HMS_MINUTE4OJ6_.R

Retrieves the minutes component from an HMS value.

MCI_HMS_SECONDR999VG

Retrieves the seconds component from an HMS value.

MCI_MAKE_HMSXADXQ.

Creates an HMS value.

MCI_MAKE_MSFXAE2VZ

Creates an MSF value.

MCI_MAKE_TMSF_PQA9H

Creates a TMSF value.

MCI_MSF_FRAME2OH93YS

Retrieves the frames component from an MSF value.

MCI_MSF_MINUTETVBZME

Retrieves the minutes component from an MSF value.

MCI_MSF_SECONDZR7TGD

Retrieves the seconds component from an MSF value.

MCI_TMSF_FRAMES4.EAL

Retrieves the frames component from a TMSF value.

MCI_TMSF_MINUTEJ3I6.F

Retrieves the minutes component from a TMSF value.

MCI_TMSF_SECOND1B8IZMU

Retrieves the seconds component from a TMSF value.

MCI_TMSF_TRACKSB.E7R

Retrieves the tracks component from a TMSF value.

 

MCI also provides two messages: MM_MCINOTIFY26GL_KY and MM_MCISIGNAL9PFCVG. The MM_MCINOTIFY message notifies an application of the outcome of an MCI command whenever that command specifies the  notify  (MCI_NOTIFY) flag. The MM_MCISIGNAL message is specific to digital-video devices; it notifies the application when a specified position is reached.